From 3c558237fd199f5abe8aa92ca034a5e235c23078 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 29 Dec 2006 11:59:47 +0000 Subject: [PATCH] (bug 6449) Throw a more definitive error message when installation fails due to an invalid database name --- RELEASE-NOTES | 2 ++ config/index.php | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4afa1647e7..bc5a5925e8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -425,6 +425,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN Linux systems with at least some versions of PHP * (bug 5908) Allow overriding the default category sort key for all items on a page using {{DEFAULTSORT}} +* (bug 6449) Throw a more definitive error message when installation fails + due to an invalid database name == Languages updated == diff --git a/config/index.php b/config/index.php index 26aa3ec5d0..830b1e408c 100644 --- a/config/index.php +++ b/config/index.php @@ -793,11 +793,16 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { print "
  • Database " . htmlspecialchars( $wgDBname ) . " exists
  • \n"; } else { $err = mysql_errno(); - if ( $err != 1049 ) { - print ""; + $databaseSafe = htmlspecialchars( $wgDBname ); + if( $err == 1102 /* Invalid database name */ ) { + print ""; + continue; + } elseif( $err != 1049 /* Database doesn't exist */ ) { + print ""; continue; } + print "
  • Attempting to create database...
  • "; $res = $wgDatabase->query( "CREATE DATABASE `$wgDBname`" ); if( !$res ) { print "
  • Couldn't create database " . -- 2.20.1